# Contributor: Thomas Harning Jr. <harningt@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=davfs2
pkgver=1.5.6
pkgrel=0
pkgdesc="Linux FUSE (or coda) driver that allows you to mount a WebDAV resource"
url="http://savannah.nongnu.org/projects/davfs2"
options="suid"
pkggroups="davfs2"
arch="all"
license="GPL-3.0-or-later"
depends_dev="libxml2-dev neon-dev zlib-dev linux-headers"
makedepends="$depends_dev autoconf automake libtool"
install="$pkgname.pre-install"
subpackages="$pkgname-doc"
source="http://mirror.lihnidos.org/GNU/savannah/davfs2/davfs2-$pkgver.tar.gz
	010-main_code_fix.patch
	100-musl-compat.patch
	fix-neon-version.patch
	"

prepare() {
	default_prepare
	aclocal -I config \
	        && autoheader \
	        && automake --add-missing --force-missing --copy \
	        && autoconf
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var \
		dav_user=nobody \
		--enable-largefile
	make
}

package() {
	make DESTDIR="$pkgdir" install
	install -Dm644 COPYING "$pkgdir"/usr/share/licenses/$pkgname/COPYING
	install -o root -g davfs2 -m 1774 -d "$pkgdir"/var/run/mount.davfs
}

sha512sums="97c3f2eef93b418d89bb387a441d0624d4eb3de614973e3f25ded5e29d6913c7aa724022b610ff36d050ca11db63c47651413a93297e235725a42879bc8ac0c2  davfs2-1.5.6.tar.gz
1d839b1435ae67209aae2501c1188880e991adece7b34b6b91d1fcba7390fd9d72d2aa7e057d03ed9f1519e682d0f0a8472c47ed64f78a25fe0f67c54a847ce3  010-main_code_fix.patch
7fd91c60ecbc9f4f88e2d3b02f1a1fb3abae64a8a0963860934b4c870b6bd45e62870899cdbfd9c6139eafc72ef12f2e9a4b2bbb5f1c2a0d6dde9c7db196d075  100-musl-compat.patch
a33b40038f1c47d0f842f907831ea13a2ca53bccca8960e39c9860e5c12b09842d220c5f0c48c15897bc45b45742088cc72cba6b6f6dd1d7073c7be700c45308  fix-neon-version.patch"
